package com.jiujia.game.sdk.base;

import android.app.Application;
import android.content.Context;

/**
 * *************************************************
 * Class: JGameContextManager
 * Author: Jiujia
 * Time: 2025/4/30 17:25
 * Description: 全局的Context
 * *************************************************
 */
public class JGameContextManager {
    private static Context applicationContext;

    private JGameContextManager() {
        // 私有构造函数，防止外部实例化
    }

    public static void init(Application mApplication) {
        if (applicationContext == null) {
            applicationContext = mApplication.getApplicationContext();
        }
    }

    public static Context getContext() {
        if (applicationContext == null) {
            throw new IllegalStateException("ContextManager not initialized. Call init() first.");
        }
        return applicationContext;
    }
}
